<?
class SignIn extends Module{
	static $openid_consumer = false;
	static $error = false;
	
	function SignIn($row){
		Module::Module($row);
		if(!User::is_login()){
			$href = Url::get('href');
			$href = base64_decode($href);
			
			require_once 'forms/sign_in.php';
			$this->add_form(new SignInForm);
		}
		else{
			$href = Url::get('href');
			$href = base64_decode($href);
			if($href){				
				$href = str_replace('SID='.$_COOKIE['PHPSESSID'],'',$href);
				Url::redirect_url($href,array('portal'));
			}
			else{
				Url::redirect('home');
			}			
		}
	}
}
?>